import pandas as pd
import matplotlib.pyplot as plt

# 加载数据
path = r"data\airline-passengers.csv"
data = pd.read_csv(path, parse_dates=["Month"], index_col="Month")

# 查看前5行
print(data.head())

# 绘制趋势图
plt.figure(figsize=(12, 6))
plt.plot(data, label="Passengers")
plt.title("Monthly Airline Passengers (1949-1960)")
plt.xlabel("Year")
plt.ylabel("Passengers (Thousands)")
plt.grid(True)
plt.legend()
plt.show()